from selenium import webdriver
from time import sleep

driver = webdriver.Firefox()
driver.get("http://www.baidu.com/")

#手动添加cookie
#通过抓包获取cookie信息
driver.add_cookie({'name':'BAIDUID','value':'2658AF78032B476E83EC92F67D7107B9:FG=1'})
driver.add_cookie({'name':'BDUSS','value':'VFxTjllMXhOVmtub0labHMtYXBQOThuaG5mV1N3YlVKOVZNQlBaYnF-QjJPZWRaSUFBQUFBJCQAAAAAAAAAAAEAAABDgiNot-XXzzEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHasv1l2rL9ZL'})

sleep(2)
driver.refresh()
sleep(3)
driver.quit()
